<?php

class Comment extends Doctrine_Record {

    public function setTableDefinition() {
        $this->hasColumn('user_id', 'integer', 20);
        $this->hasColumn('support_id', 'integer', 20);
        $this->hasColumn('comment_text', 'string', 255);
    }

    public function setUp() {
        $this->actAs('Timestampable');
        $this->hasOne('User', array(
            'local' => 'user_id',
            'foreign' => 'id',
            'onDelete' => 'CASCADE'
                )
        );
        $this->hasOne('Support', array(
            'local' => 'support_id',
            'foreign' => 'id',
            'onDelete' => 'CASCADE'
                )
        );
    } 

}

